<!DOCTYPE html>
<html>
<head>
<title><?php echo $meta_title ?><?php echo $webinfo['WEB_SITE_TITLE']?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="<?php echo __STATIC__?>bootstrap3/css/bootstrap.min.css" type="text/css" rel="stylesheet">
<link href="<?php echo __STATIC__?>bootstrap3/css/bootstrap-theme.min.css" type="text/css" rel="stylesheet">
<!--  CSS -->
<link href="<?php echo __STATIC__?>jsshow/css/bootstrap-modal-bs3patch.css" rel="stylesheet" />
<link href="<?php echo __STATIC__?>jsshow/css/bootstrap-modal.css" rel="stylesheet" />
</head>
<body>
<div class="row">
	<?php if( $success < 1 ){?>
		<blockquote>
			<h4 style="color: red">参数错误</h4>
		</blockquote>
	<?php }?>
	<form name="joinform" id="joinform" method="post" action="<?php echo site_url('patent/applyed'); ?>" class="form-horizontal">
		<div class="col-sm-12 col-md-11 col-lg-11">
			<div class="form-group">
				<label for="inputEmail3" class="col-sm-3 control-label lab">
					<i class="text-danger pt_r5">*</i>
					称呼
				</label>
				<div class="col-sm-9 cs_inputfl0">
					<input type="text" class="form-control cs_input" id="real_name"	name="real_name" placeholder="您的称呼">
				</div>
			</div>
			<div class="form-group">
				<label for="inputEmail3" class="col-sm-3 control-label lab">
					<i class="text-danger pt_r5">*</i>
					手机号码
				</label>
				<div class="col-sm-9 cs_inputfl0">
					<input type="text" class="form-control cs_input" id="mobile" name="mobile" placeholder="您的手机号码">
				</div>
			</div>
			<div class="form-group">
				<label for="inputEmail3" class="col-sm-3 control-label lab">Email</label>
				<div class="col-sm-9 cs_inputfl0">
					<input type="text" class="form-control cs_input" id="email" name="email" placeholder="您的邮箱地址">
				</div>
			</div>
			<!-- <div class="form-group">
				<label for="inputEmail3" class="col-sm-3 control-label lab">QQ号</label>
				<div class="col-sm-9 cs_inputfl0">
					<input type="text" class="form-control cs_input" id="qq" name="qq" placeholder="您的QQ号">
				</div>
			</div>
			<div class="form-group">
				<label for="inputEmail3" class="col-sm-3 control-label lab">微信</label>
				<div class="col-sm-9 cs_inputfl0">
					<input type="text" class="form-control cs_input" id="weixin" name="weixin" placeholder="您的微信号">
				</div>
			</div> -->
			<div class="form-group">
				<label class="col-sm-3 control-label lab">
					验证码<br>
					<span style="pointer-events:auto;"><a href="javascript:void(0);" id="reload-captcha" onclick="getcode('codeshow')" >换一张</a></span>
				</label>
				<div class="col-sm-9 cs_inputfl0">
					<input type="text" class="form-control cs_input" id="verify" name="verify" placeholder="请填写验证码" autocomplete="off">
					<div style="padding-top:10px;" id="codeshow"></div>
				</div>
			</div> 
			<?php if( $success > 0 ){?>
			<input type="hidden" name="patent_info" value='<?php echo $info;?>' >
			<div class="col-sm-12 col-md-12 col-lg-12">
				<div class="modal-footer" style="text-align: center;">
					<button type="submit" value="Submit" class="btn btn-primary">提交信息</button>
				</div>
			</div>
			<?php }?>
		</div>
		
	</form>
</div>

<script type="text/javascript" src="<?php echo __STATIC__?>plugins/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo __STATIC__?>bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="<?php echo __STATIC__?>jqueryvalidate/jquery.validate.js"></script>
<script type="text/javascript" src="<?php echo __STATIC__?>jqueryvalidate/additional-methods.js"></script>
<script type="text/javascript" src="<?php echo __STATIC__?>jqueryvalidate/messages_zh.min.js"></script>
<script type="text/javascript" src="<?php echo __STATIC__?>js/jquery.form.js"></script>
<script type="text/javascript">
	$().ready(function() {
		getcode('codeshow',230);//获取验证码
		$("#joinform").validate({
			rules : {
				real_name : {
					required : true,
					minlength:2,
				},	
				mobile : {
					required : true,
					lenientTel : true,
				},
				verify :{
					required : true,
					minlength:6,
					maxlength:6,
				}
			},
			messages : {
				real_name:{
					required : '请填写联系人称呼',
					minlength:'最少为两个汉字',
				},
				mobile : {
					required : '请填写联系电话',
					lenientTel : '请填写正确的联系电话',
				},
				verify :{
					required : '请填写验证码',
					minlength:'请确认验证码在填写',
					maxlength:'请确认验证码在填写',
				}
			},
			submitHandler:function(form){
	            $("#joinform").ajaxSubmit({
	            	type:"post",  //提交方式  
					dataType:"json", //数据类型  
					success:function(res){ //提交成功的回调函数 
						if(res.status > 0) {
							$("#joinform").clearForm();//清除表单数据
							message_box.show(res.info, 'success');
							setTimeout(function(){window.location.href=res.url}, 3000);//跳转
						}else if (res.status <= 0) {
							message_box.show(res.info, 'error');
							if( res.url.length > 0 ){
								setTimeout(function(){window.location.href=res.url}, 3000);//跳转
							}	
							return false;
						}
					} 
	            });
	        } 
		});
		
	});
</script>
</body>
</html>